#!/bin/bash

set -eu

export GOPATH="$HOME/go"
export PATH="$PATH:$GOPATH/bin"

go get "golang.org/x/tools/cmd/goimports"

goimports -w $(find . -type f -name '*.go' -not -path "./vendor/*") || true

env GO111MODULE=on GOOS=$(uname -s | tr '[:upper:]' '[:lower:]') GOARCH=amd64 go build -a
